Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: suspend auctions during prerendering #12763

Merged
merged 4 commits into from
Feb 20, 2025
Merged

Conversation

dgirardi
Copy link
Collaborator

Type of change

  • Feature

Description of change

If the document is being prerendered, delay auctions until the page is activated.

Other information

Closes #12724

@patmmccann
Copy link
Collaborator

lgtm, can we document !(config.getConfig('allowPrerendering')

src/prebid.js Outdated
Comment on lines 1048 to 1054
pbjsInstance.processQueue = delayIfPrerendering(function () {
pbjsInstance.que.push = pbjsInstance.cmd.push = quePush;
insertLocatorFrame();
hook.ready();
processQueue(pbjsInstance.que);
processQueue(pbjsInstance.cmd);
};
});
Copy link

@marco-prontera marco-prontera Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dgirardi I have a question, since now the processQueue is called when the prebid instance is ready, introducing this change will introduce the delay of all the queues, right?

I understood that the delay was actually only related to the requestBids, and this seems fantastic because we can execute everything in the prerendering "phase" and then firing only the auctions when the user actually views the page.
Can you tell me if I'm wrong? Sorry in advance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good suggestion. I defaulted to delaying everything because it seemed safer, but we couldn't think of an example of something that would break if we delayed only auctions. Updated.

@patmmccann patmmccann merged commit 13b18fa into master Feb 20, 2025
6 checks passed
@patmmccann patmmccann deleted the no-prerendered-auctions branch February 20, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle Speculation Rules Prerender page activation in Prebid.js
3 participants